﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SessionDemo
{
    public partial class Home : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack) {
                if (Session["Username"] != null)
                {
                    lblUsername.Text = Session["Username"].ToString();
                }
                //else {
                //    Response.Redirect("Login.aspx");
                //}
                if (Session["Password"] != null) {
                    lblPassword.Text = Session["Password"].ToString();
                }
                if(Session["Fullname"] != null){
                    lblFullName.Text = Session["Fullname"].ToString();
                }
                if(Session["TimeOnline"] != null){
                    lblTimeOnline.Text = Session["TimeOnline"].ToString();
                }
                if (Session["ClientIP"] != null) {
                    lblClientIP.Text = Session["ClientIP"].ToString();
                }
            }
        }
    }
}